package com.ep.modules.app.controller;

import com.ep.common.annotation.SysLog;
import com.ep.common.utils.PageUtils;
import com.ep.common.utils.R;
import com.ep.common.validator.ValidatorUtils;
import com.ep.modules.app.entity.AppQualityTrend;
import com.ep.modules.app.service.AppQualityTrendService;
import java.util.Map;
import org.springframework.beans.factory.annotation.*;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/app/quality_trend")
public class AppQualityTrendController {
    @Autowired
    private AppQualityTrendService appQualityTrendService;

    @GetMapping("/list")
    public R list(Map<String, Object> params) {
        PageUtils page = appQualityTrendService.queryPage(params);
        return R.ok().put("page", page);
    }

    @GetMapping("/info/{id}")
    public R info(@PathVariable Long id) {
        AppQualityTrend appqualitytrend = appQualityTrendService.getById(id);
        return R.ok().put("appqualitytrend", appqualitytrend);
    }

    @SysLog("保存AppQualityTrend")
    @PostMapping("/save")
    public R save(@RequestBody AppQualityTrend appqualitytrend) {
        ValidatorUtils.validateEntity(appqualitytrend);
        appQualityTrendService.save(appqualitytrend);
        return R.ok();
    }

    @SysLog("修改AppQualityTrend")
    @PostMapping("/update")
    public R update(@RequestBody AppQualityTrend appqualitytrend) {
        ValidatorUtils.validateEntity(appqualitytrend);
        appQualityTrendService.update(appqualitytrend);
        return R.ok();
    }

    @SysLog("删除AppQualityTrend")
    @PostMapping("/delete")
    public R delete(@RequestBody Long[] ids) {
        appQualityTrendService.deleteBatch(ids);
        return R.ok();
    }
}